<template>
  <div class="row justify-between">
    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
      <q-card class="shadow-2">
        <q-card-section class="q-pa-sm">
          <div class="row items-center no-wrap">
            <div class="col">
              <q-chip square class="no-border-radius q-ml-none q-mr-none text-weight-bold">
                <q-avatar class="no-border-radius" icon="business" color="light-blue" text-color="white"></q-avatar>
                <!-- {{ baseInfoForm.code }} -->
              </q-chip>
            </div>
            <div class="col-auto">
              <q-btn color="grey-7" round flat icon="more_vert">
                <q-menu cover auto-close>
                  <q-list>
                    <q-item clickable @click="$router.go(-1)">
                      <q-item-section>返回</q-item-section>
                    </q-item>
                  </q-list>
                </q-menu>
              </q-btn>
            </div>
          </div>
        </q-card-section>
        <q-separator />
        <!-- <q-card-section class="q-pa-sm">
          <main-field v-if="baseInfoForm.id" :form="baseInfoForm" :field="fieldConfig"></main-field>
        </q-card-section> -->
      </q-card>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      data: [],
      id: ''
    }
  },
  created () {
    this.id = this.$router.params.id
    this.getTop()
  },
  methods: {
    async getTop () {
      await this.$api({
        method: 'get',
        url: `/mdm/item/findById/${this.id}`,
        successCallback: ({ data }) => {
          // this.baseInfoForm = {
          //   name: String,
          //   code: String,
          //   nameEn: String,
          //   createUserName: String,
          //   createTime: String,
          //   lastUpdateTime: String,
          //   remark: String
          // }
          // this.baseInfoForm = { ...data }
        },
        errorCallback (err) {
          console.log('未处理的业务级error：', err)
        }
      })
    }
  }
}
</script>
